<template>
    <view class="Articles_MSG_add">
        <u-toast ref="uToast"></u-toast>
        <!-- 取 -->
        <view class="address flex_al_cen_ju_bet">
            <view class="Tack flex_b">
                <view :class="Type == 1 ? 'leftwidth' : ''" class="left text_ovf">
                    <!--overListShow 是否是外卖-->
                    <template v-if="item.overListShow">
                        <view class="from add">取</view>
                    </template>
                    <template v-else>
                        <!--riderDo 0 帮我送 1 帮我买 2帮我取-->
                        <view class="from add">
                            {{ item.riderDo == 1 ? '买' : '取' }}
                        </view>
                    </template>
                    <text v-if="TitleShow">
                        {{
                            item.riderToMerchantDistance == undefined ? item.pickAddressDistance + 'km' : item.riderToMerchantDistance + 'km'
                        }}
                    </text>
                </view>
                <!--外卖 取货地址-->
                <view class="add" v-if="item.orderType == 0">
                    <view :class="Type == 1 ? 'H2' : 'H4'"> {{ item.pickAddress }}
                    </view>
                    <view class="phone" v-if="TitleShow">
                        {{ item.pickAddress }}
                    </view>
                </view>
                <!--跑腿 取货地址-->
                <view class="add" v-else>
                    <view class="H4" v-if="item.sfBuy">就近购买仅支持1公里内产品</view>
                    <view :class="Type == 1 ? 'H2' : 'H4'">{{ item.pickAddress }} </view>
                    <view class="phone" v-if="item.pickPhone && item.riderDo != 0">
                        {{ item.pickName }}
                        {{
                            item.pickPhone.substring(0, 3) + '****' + item.pickPhone.substring(item.pickPhone.length - 4)
                        }}
                    </view>
                </view>
            </view>
            <!-- 占位 -->
        </view>
        <!-- 收 -->
        <view class="address flex_al_cen_ju_bet">
            <view class="To flex">
                <view :class="Type == 1 ? 'leftwidth' : ''" class="left text_ovf">
                    <view class="to add">收</view>
                    <text v-if="TitleShow && Type != 1">{{
                            item.riderToUserDistance == undefined ? item.receiveAddressDistance +
                                'km'
                                : item.riderToUserDistance + 'km'
                        }}
                    </text>
                </view>
                <!-- 外卖收货地址 -->
                <view class="add" v-if="orderType == 0">
                    <view :class="Type == 2 ? 'H2' : 'H4'">{{ item.receiveAddress }}
                    </view>
                    <view class="phone" v-if="item.phone && TitleShow"> {{ item.pickName }}
                        {{ item.phone.substring(0, 3) + '****' + item.phone.substring(item.phone.length - 4) }}
                    </view>
                </view>
                <!-- 跑腿收货地址 -->
                <view class="add" v-if="orderType == 1">
                    <view :class="Type == 2 ? 'H2' : 'H4'">{{ item.receiveAddress }}</view>
                    <!-- <view :class="Type == 1 ? 'H2' : 'H4'">附近三公里购买</view> -->
                    <view class="phone" v-if="item.receiveName && Type != 0">
                        {{ item.receiveName }} {{
                            item.receivePhone.substring(0, 3) + '****' +
                            item.receivePhone.substring(item.receivePhone.length - 4)
                        }}
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
<script setup lang="ts">
import {defineProps, ref} from "vue";

/**
 *     @param  {Type}// 订单状态 {0,1,2}
 *     @param { orderType }  0 外卖  1  跑腿
 *     @param { Adddesc } 是否显示用户信息
 *     @param { pickAddress } 取货地址
 *     @param { receiveAddress }  收货地址
 *     @param { riderToUserDistance }  骑手到用户的距离
 *     @param { riderToMerchantDistance } 骑手到商家的距离
 * }  组件配置
 */
const Props = defineProps<Props>();

interface Props {
    Type?: number; //
    orderType?: number
    item: any,
    TitleShow: any
}


</script>
<style lang="scss" scoped>
@import "../static/css/component/address.scss";
</style>
